/**
 * 0080
 *  
 * @Author : roryrywang
 * @DateTime : 24-8-29 下午10:56
 */

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    int removeDuplicates(vector<int> &nums) {
        int j = 0;
        for (int i = 0; i < nums.size(); ++i) {
            if (j >= 2 && nums[i] == nums[j - 2]) continue;
            nums[j++] = nums[i];
        }
        return j;
    }
};

int main() {

    return 0;
}